#include "TcpServer.hpp"
#include"Command.hpp"
#include <memory>

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cerr << "Usage:" << argv[0] << "server-ip server-port" << std::endl;
        exit(0);
    }
    uint16_t port = std::stoi(argv[1]);

    Command cmdserver;
    std::unique_ptr<TcpServer> tsptr = std::make_unique<TcpServer>(
        std::bind(&Command::HandlerCommand,&cmdserver,std::placeholders::_1,std::placeholders::_2),port);
    tsptr->InitServer();
    tsptr->Loop();
    return 0;
}